load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "userfile",
    srcs = [
        "file_table_connection.go",
        "file_table_storage.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/cloud/userfile",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/cloud",
        "//pkg/cloud/cloudpb",
        "//pkg/cloud/externalconn",
        "//pkg/cloud/externalconn/connectionpb",
        "//pkg/cloud/externalconn/utils",
        "//pkg/cloud/userfile/filetable",
        "//pkg/security/username",
        "//pkg/server/telemetry",
        "//pkg/settings/cluster",
        "//pkg/util/ioctx",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
    ],
)

go_test(
    name = "userfile_test",
    srcs = [
        "file_table_storage_test.go",
        "main_test.go",
    ],
    deps = [
        ":userfile",
        "//pkg/base",
        "//pkg/blobs",
        "//pkg/cloud",
        "//pkg/cloud/cloudtestutils",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/sql/isql",
        "//pkg/sql/sem/tree",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_stretchr_testify//require",
    ],
)
